#ifndef ELEMENTS_ROLE_H
#define ELEMENTS_ROLE_H

#include "common/more/flags.hpp"
#include "common/more/json.h"

#include "permissions.hpp"

#include "element.h"

namespace Elements
{

struct Role : public Element
{
    Role() = default;
    Role(const Role& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    std::string caption() const;
    void setCaption(const std::string& value);

    std::string description() const;
    void setDescription(const std::string& value);

    BasePermissions basePermissions() const;
    void setBasePermissions(const BasePermissions& value);

private:
    std::string m_caption;
    std::string m_description;
    BasePermissions m_basePermissions;

};

typedef std::shared_ptr<Role> RolePtr;
typedef std::vector<RolePtr> Roles;

} // namespace Elements

#endif // ELEMENTS_ROLE_H
